package cn.lyjuan.android.mylibrary.context;

import android.app.Application;
import android.content.Context;

/**
 * 基础Application，提供 context 静态获取
 * Created by chad on 06/11/2017.
 */
public class BaseApplication extends Application
{
    protected static Context context;

    @Override
    public void onCreate()
    {
        super.onCreate();

        context = getApplicationContext();
    }

    public static Context getContext()
    {
        if (null == context)
            throw new IllegalStateException("base application not load");
        return context;
    }
}
